<template>
  <div class="app-container">
    <!--工具栏-->
    <div class="head-container">
      <!--如果想在工具栏加入更多按钮，可以使用插槽方式， slot = 'left' or 'right'-->
      <crudOperation :permission="permission" />
      <!--表单组件-->
      <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
        <el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
          <el-form-item label="就诊登记ID">
            <el-input v-model="form.bisFymxJzdjId" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="就诊流水号">
            <el-input v-model="form.bisFymxJzdjLsh" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="医保卡号">
            <el-input v-model="form.bisFymxYbkh" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="交易类型（1收费，-1退费）">
            <el-input v-model="form.bisFymxYjlx" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="医院药品编码">
            <el-input v-model="form.bisFymxYyypbm" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="处方号">
            <el-input v-model="form.bisFymxCfh" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="开方日期">
            <el-input v-model="form.bisFymxKfrq" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="医保中心编码">
            <el-input v-model="form.bisFymxYbypbm" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="项目名称">
            <el-input v-model="form.bisFymxMc" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="单价">
            <el-input v-model="form.bisFymxDj" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="数量">
            <el-input v-model="form.bisFymxSl" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="总价（单价*数量 退费时仍为正值）">
            <el-input v-model="form.bisFymxZj" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="剂型">
            <el-input v-model="form.bisFymxJx" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="剂量">
            <el-input v-model="form.bisFymxJl" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="使用频次">
            <el-input v-model="form.bisFymxSypc" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="用法">
            <el-input v-model="form.bisFymxYf" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="执行科室">
            <el-input v-model="form.bisFymxZxks" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="执行天数">
            <el-input v-model="form.bisFymxZxts" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="医保收费类别">
            <el-input v-model="form.bisFymxYbsflb" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="审批人">
            <el-input v-model="form.bisFymxSpr" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="重点项目监控码">
            <el-input v-model="form.bisFymxZdxmjkm" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="医生姓名">
            <el-input v-model="form.bisFymxYsxm" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="经办人">
            <el-input v-model="form.bisFymxJbr" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="医院收费类别">
            <el-input v-model="form.bisFymxYysflb" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="单位">
            <el-input v-model="form.bisFymxDw" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="规格">
            <el-input v-model="form.bisFymxGg" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="处方药标志（1处方药 0非处方药）">
            <el-input v-model="form.bisFymxCfybz" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="包装数量">
            <el-input v-model="form.bisFymxBzsl" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="每次用量">
            <el-input v-model="form.bisFymxYl" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="中国药品电子监管码">
            <el-input v-model="form.bisFymxYpdzjgm" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="医保个人编号">
            <el-input v-model="form.bisFymxGrbh" style="width: 370px;" />
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="crud.cancelCU">取消</el-button>
          <el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
        </div>
      </el-dialog>
      <!--表格渲染-->
      <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
        <el-table-column type="selection" width="55" />
        <el-table-column prop="bisFymxJzdjId" label="就诊登记ID" />
        <el-table-column prop="bisFymxJzdjLsh" label="就诊流水号" />
        <el-table-column prop="bisFymxYbkh" label="医保卡号" />
        <el-table-column prop="bisFymxYjlx" label="交易类型（1收费，-1退费）" />
        <el-table-column prop="bisFymxYyypbm" label="医院药品编码" />
        <el-table-column prop="bisFymxCfh" label="处方号" />
        <el-table-column prop="bisFymxKfrq" label="开方日期" />
        <el-table-column prop="bisFymxYbypbm" label="医保中心编码" />
        <el-table-column prop="bisFymxMc" label="项目名称" />
        <el-table-column prop="bisFymxDj" label="单价" />
        <el-table-column prop="bisFymxSl" label="数量" />
        <el-table-column prop="bisFymxZj" label="总价（单价*数量 退费时仍为正值）" />
        <el-table-column prop="bisFymxJx" label="剂型" />
        <el-table-column prop="bisFymxJl" label="剂量" />
        <el-table-column prop="bisFymxSypc" label="使用频次" />
        <el-table-column prop="bisFymxYf" label="用法" />
        <el-table-column prop="bisFymxZxks" label="执行科室" />
        <el-table-column prop="bisFymxZxts" label="执行天数" />
        <el-table-column prop="bisFymxYbsflb" label="医保收费类别" />
        <el-table-column prop="bisFymxSpr" label="审批人" />
        <el-table-column prop="bisFymxZdxmjkm" label="重点项目监控码" />
        <el-table-column prop="bisFymxYsxm" label="医生姓名" />
        <el-table-column prop="bisFymxJbr" label="经办人" />
        <el-table-column prop="bisFymxYysflb" label="医院收费类别" />
        <el-table-column prop="bisFymxDw" label="单位" />
        <el-table-column prop="bisFymxGg" label="规格" />
        <el-table-column prop="bisFymxCfybz" label="处方药标志（1处方药 0非处方药）" />
        <el-table-column prop="bisFymxBzsl" label="包装数量" />
        <el-table-column prop="bisFymxYl" label="每次用量" />
        <el-table-column prop="bisFymxYpdzjgm" label="中国药品电子监管码" />
        <el-table-column prop="bisFymxGrbh" label="医保个人编号" />
        <el-table-column v-if="checkPer(['admin','fymx:edit','fymx:del'])" label="操作" width="150px" align="center">
          <template slot-scope="scope">
            <udOperation
              :data="scope.row"
              :permission="permission"
            />
          </template>
        </el-table-column>
      </el-table>
      <!--分页组件-->
      <pagination />
    </div>
  </div>
</template>

<script>
import crudFymx from '@/api/business/fymx'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'

const defaultForm = { bisFymxId: null, bisFymxJzdjId: null, bisFymxJzdjLsh: null, bisFymxYbkh: null, bisFymxYjlx: null, bisFymxYyypbm: null, bisFymxCfh: null, bisFymxKfrq: null, bisFymxYbypbm: null, bisFymxMc: null, bisFymxDj: null, bisFymxSl: null, bisFymxZj: null, bisFymxJx: null, bisFymxJl: null, bisFymxSypc: null, bisFymxYf: null, bisFymxZxks: null, bisFymxZxts: null, bisFymxYbsflb: null, bisFymxSpr: null, bisFymxZdxmjkm: null, bisFymxYsxm: null, bisFymxJbr: null, bisFymxYysflb: null, bisFymxDw: null, bisFymxGg: null, bisFymxCfybz: null, bisFymxBzsl: null, bisFymxYl: null, bisFymxYpdzjgm: null, ywlx: null, lrr: null, lrrxm: null, lrbm: null, lrbmmc: null, lrsj: null, gxr: null, gxrxm: null, gxbm: null, gxbmmc: null, gxsj: null, sfyx: null, bz: null, bisFymxGrbh: null }
export default {
  name: 'Fymx',
  components: { pagination, crudOperation, rrOperation, udOperation },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  cruds() {
    return CRUD({ title: '费用明细', url: 'api/fymx', idField: 'bisFymxId', sort: 'bisFymxId,desc', crudMethod: { ...crudFymx }})
  },
  data() {
    return {
      permission: {
        add: ['admin', 'fymx:add'],
        edit: ['admin', 'fymx:edit'],
        del: ['admin', 'fymx:del']
      },
      rules: {
      }
    }
  },
  methods: {
    // 钩子：在获取表格数据之前执行，false 则代表不获取数据
    [CRUD.HOOK.beforeRefresh]() {
      return true
    }
  }
}
</script>

<style scoped>

</style>
